<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-row>
      <el-col :span='22' :xs='24'>
        <el-form ref="form" :model="client_cert" :rules="rules" label-width="100px" id="mvcfm">
          <el-button @click="gotoPage('/psi/supplychainmana/SubsidiaryInformationSupplier?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>返回</el-button>
          <el-button @click="addCertificateSupplierSubmit('')" type='success' size="mini"><i class='fa fa-check'></i>保存</el-button>
          <div class="form-unit">
            <span class="mvc-title-left"> 证书信息 </span>
          </div>
          <div>
            <el-row>
              <el-col :span="24">
                <el-form-item label="证书类型" prop="cert_type">
                  <el-radio-group v-model="client_cert.cert_type" onClick='javascript:updateFrom(this.value)'>
                    <el-radio-button label="体系认证">体系认证</el-radio-button>
                    <el-radio-button label="产品认证">产品认证</el-radio-button>
                  </el-radio-group>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item label="证书编号" prop="cert_num">
                  <div class="el-select">
                    <el-input v-model="client_cert.cert_num" />
                  </div> 发证单位 <div class="el-select">
                    <el-input v-model="client_cert.issuing_agency" />
                  </div> 发证时间
                  <el-date-picker v-model="client_cert.cert_date" type="date" value-format="yyyy-MM-dd" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item label="证书内容" prop="cert_content">
                  <div class="el-select">
                    <el-input v-model="client_cert.cert_content" />
                  </div> 证书标准 <div class="el-select">
                    <el-input v-model="client_cert.cert_criterion" />
                  </div> 证书范围 <div class="el-select">
                    <el-input v-model="client_cert.cert_range" />
                  </div>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item label="产品名称" prop="prdt_name">
                  <div class="el-select">
                    <el-input v-model="client_cert.prdt_name" />
                  </div> 产品型号 <div class="el-select">
                    <el-input v-model="client_cert.prdt_model" />
                  </div> 产品规格 <div class="el-select">
                    <el-input v-model="client_cert.prdt_norm" />
                  </div>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="产品商标" prop="prdt_brand">
                  <el-input v-model="client_cert.prdt_brand" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item label="审核时间" prop="last_examine_date">
                  <el-date-picker v-model="client_cert.last_examine_date" type="date" value-format="yyyy-MM-dd" /> 预计下次审核时间
                  <el-date-picker v-model="client_cert.next_examine_date" type="date" value-format="yyyy-MM-dd" /> 下次审核提醒时间
                  <el-date-picker v-model="client_cert.next_remind_date" type="date" value-format="yyyy-MM-dd" />
                </el-form-item>
              </el-col>
            </el-row>
          </div>
        </el-form>
      </el-col>
      <el-col :span='2' :xs='24'>
        <el-menu default-active='active' class='menu-unit'>
          <el-menu-item v-for='item in Container'>
            <el-link @click="gotoMenu(item.url)" :type="'附属信息'===item.name?'primary':'default'">{{item.page_desc||item.name}}</el-link>
          </el-menu-item>
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'AddCertificateSupplier',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        client_cert: {
          cert_type: null,
          cert_num: null,
          issuing_agency: null,
          cert_date: null,
          cert_content: null,
          cert_criterion: null,
          cert_range: null,
          prdt_name: null,
          prdt_model: null,
          prdt_norm: null,
          prdt_brand: null,
          last_examine_date: null,
          next_examine_date: null,
          next_remind_date: null,
        },
        loading: false,
        Container: null,
        rules: {}
      }
    },
    created() {
      this.loadContainerMenu({
        pid: "D341BEFC81C14E98804E008EC7E6F3E5",
        name: "供应商右菜单管理",
        selected: "附属信息"
      }, 'Container', this.vueparams);
    },
    updated() {},
    mounted() {},
    methods: {
      addCertificateSupplierSubmit(_params) {
        request({
          method: 'post',
          url: '/xcapi/VUEAction/psi/supplychainmana/SubsidiaryInformationSupplier/addCertificateSupplierSubmit?' + _params + this.vueparams,
          data: this.postData()
        }).then(data => {
          this.gotoPage("/psi/supplychainmana/SubsidiaryInformationSupplier/subsidiaryInformationSupplier?" + this.vueparams, data);
          this.msgSuccess(data.msg);
        })
      },
    },
  }
</script>
